﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Linq ;

namespace W7Toshil.Entity
{

    public class  TransactionView
    {
        public string Header
        {
            get;
            set;
        }

        public IList<Expense> TransactionDetail
        {
            get;
            set;
        }

        public decimal TotalAmount
        {
            get 
            {
                decimal totalAmount = 0;
                if (null != TransactionDetail)
                {
                    totalAmount = this.TransactionDetail.Sum<Expense>(delegate(Expense expense)
                    {
                        return expense.Amount;
                    });
                    
                }

                return totalAmount;
            }
        }
    }
    
}
